<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#time{width: 280px;background-color: black;color: white;}
		</style>
	</head>

	<body>
		<div id="time"></div>

		<script type="text/javascript">
			function checkWeek(week){
				var wk="";
				switch (week){
					case 0:
					wk="星期日";
						break;
						case 1:
						wk="星期一";
						break;
						case 2:
						wk="星期二";
						break;
						case 3:
						wk="星期三";
						break;
						case 4:
						wk="星期四";
						break;
						case 5:
						wk="星期五";
						break;
					default:
					wk="星期六";
						break;
				}
				return wk;
			}

			setInterval(function() {
				var time = new Date();
				var year = time.getFullYear();
				var month = time.getMonth() + 1;
				month = check(month);
				var nowday = time.getDate();
				nowday = check(nowday);
				var hours = time.getHours();
				hours = check(hours);
				var minutes = time.getMinutes();
				minutes = check(minutes);
				var second = time.getSeconds();
				second = check(second);
				var week = time.getDay();
				
				var wk = checkWeek(week);
				var str = year + "年" + month + "月" + nowday + "日" + " " + hours + ":" + minutes + ":" + second + " " + wk;
				document.getElementById("time").innerHTML = str;
			}, 1000);
			function check(n) {
				var st = "";
				if(n < 10) {
					st = "0" + n;
				} else {
					st = n;
				}
				return st;
			}

		</script>
	</body>

</html>